const Sequelize = require('sequelize')
const config = require('./db.config')()

const mysqlDB = new Sequelize(config.db_name, config.db_user, config.db_pwd, {
  host: config.db_host,
  dialect: 'mysql',
  dialectOptions: {
    charset: 'utf8mb4',
    supportBigNumbers: true,
    bigNumberStrings: true
  },
  pool: {
    max: 5,
    min: 0,
    acquire: 30000,
    idle: 10000
  },
  timezone: '+08:00'
})

module.exports = mysqlDB
